package com.atldy.commerce.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;

/**
 * @version 1.0
 * @Author: lidongyang
 * @CreateTime: 2021-08-07 20:17
 * @Description： 路由网关配置
 */
//@Configuration
@Slf4j
public class GatewayRouteConfig {

    public RouteLocator routeLocator(RouteLocatorBuilder locatorBuilder) {
        log.info("路由映射:[{}]","e_commerce_authority");
        return locatorBuilder.routes()
                .route(
                        "e_commerce_authority",
                        r -> r.path(
                                "/imooc/commerce/login",
                                "/imooc/commerce/register"
                        ).uri("http://127.0.0.1:9006/")
                ).build();
    }
}